Skip to content

Two fixes#74

Merged
shannonbooth merged 2 commits intomainfrom
two-more-fixes
Apr 5, 2026
Merged

Two fixes#74
shannonbooth merged 2 commits intomainfrom
two-more-fixes

Conversation

@shannonbooth
Copy link
Copy Markdown
Owner

see commits

fgetc() returns an int so it can represent every byte value plus EOF.
Casting that result directly to char loses the EOF sentinel and can
produce an ordinary byte value instead, depending on the platform's
char signedness.
A unified diff that removes all lines from a file uses a new file range of
0,0, but that does not mean the file should be deleted. We were inferring
Operation::Delete from that hunk header alone, so applying such a patch
removed the target file entirely instead of leaving it as an empty file.

Match traditional patch behavior by only inferring add/delete from /dev/null
headers when file paths are present, and keep the old hunk-range fallback for
headerless cases.
@shannonbooth shannonbooth merged commit fcf718f into main Apr 5, 2026
9 checks passed
@shannonbooth shannonbooth deleted the two-more-fixes branch April 5, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant